package cn.czk.demo;


import dev.langchain4j.data.image.Image;
import dev.langchain4j.model.openai.OpenAiImageModel;
import dev.langchain4j.model.output.Response;
import dev.langchain4j.model.zhipu.ZhipuAiEmbeddingModel;
import dev.langchain4j.model.zhipu.ZhipuAiImageModel;

import java.time.Duration;

public class ImageDemo {

    public static void main(String[] args) {

        ZhipuAiImageModel model = ZhipuAiImageModel.builder()
                .apiKey("53e452feb1164ec8a6c9cd9112a37d60.xTOwz9t4NIZuYTYb")
                .logRequests(true)
                .logResponses(true)
                .maxRetries(1)
                .callTimeout(Duration.ofSeconds(60))
                .connectTimeout(Duration.ofSeconds(60))
                .writeTimeout(Duration.ofSeconds(60))
                .readTimeout(Duration.ofSeconds(60))
                .build();

        Response<Image> response = model.generate("中国风机甲");
        System.out.println(response.content().url());

    }
}
